# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=meterssh
pkgver=18.9a5ed19
pkgrel=3
groups=('blackarch' 'blackarch-backdoor' 'blackarch-networking')
pkgdesc='A way to take shellcode, inject it into memory then tunnel whatever port you want to over SSH to mask any type of communications as a normal SSH connection.'
arch=('any')
url='https://github.com/trustedsec/meterssh'
license=('custom:unknown')
depends=('python2' 'metasploit')
makedepends=('git')
source=("git+https://github.com/trustedsec/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|/usr/bin/python|/usr/bin/python2|' monitor.py
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 monitor.py "$pkgdir/usr/bin/meterssh-monitor"
  install -Dm 644 "$pkgname.py" "$pkgdir/usr/share/$pkgname/$pkgname.py"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGELOG.txt
}

